package com.tm.article.controller;

import com.tm.article.Dto.ArticleDto;
import com.tm.article.service.ApArticleContentService;
import com.tm.article.service.ArticleSerivce;
import com.tm.media.model.entity.ApArticleContentEntity;
import com.tm.media.model.entity.ApUserLetterEntity;
import com.tm.media.model.entity.ArticleEntity;
import com.tm.media.utils.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("api/v1/article")
public class ArticleController {
    @Autowired
    private ArticleSerivce articleSerivce;
    @Autowired
    private ApArticleContentService apArticleContentService;
    @PostMapping("load")
    private Result loadArticle(@RequestBody ArticleDto articleDto) {
       return articleSerivce.loadArticle(articleDto);
    }
    @PostMapping("load_article_behavior")
    public Result load_article_behavior(@RequestBody ArticleEntity article){
        return articleSerivce.load_article_behavior(article);
    }
    @PostMapping("load_article_info")
    public Result load_article_info(@RequestBody ApArticleContentEntity apArticleContentEntity){
        return  apArticleContentService.load_article_info(apArticleContentEntity);
    }
    @PostMapping("black")
    public Result black(Integer id,Integer type){
       return apArticleContentService.black(id,type);
    }
    @PostMapping("sixin")
    public Result sixin(@RequestBody ApUserLetterEntity apUserLetterEntity){
        return apArticleContentService.sixin(apUserLetterEntity);
    }
}
